package com.example.demo.hcontroller;

import com.example.demo.pojo.*;
import com.example.demo.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;


@Controller
@RequestMapping(value = "/ht")
public class HIndexController {





    @Autowired
    private IHouserService HouserService;

    @Autowired
    private ITpaperService TpaperService;

    @RequestMapping("/toindex")
    private String toindex(Model model){
    

        List<Houser> hlist=HouserService.selectHouser();
        model.addAttribute("customernum", hlist.size());

        List<Tpaper> Tpaperlist=TpaperService.selectTpaper();
        model.addAttribute("Tpapernum", Tpaperlist.size());
        return "index"; 
    }

    @RequestMapping("/toleft")
    private String toleft(Model model){
        System.out.println("访问头部");
        return "left";
    }
}
